package com.xuecheng.content.service;

import com.xuecheng.commons.model.vo.ResponseResult;
import com.xuecheng.content.domain.CoursePub;
import com.baomidou.mybatisplus.extension.service.IService;
import freemarker.template.TemplateException;
import io.minio.errors.*;

import java.io.IOException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.util.Map;

/**
 * <p>
 * 课程发布 服务类
 * </p>
 *
 * @author HuangYuwu
 * @since 2022-09-11
 */
public interface CoursePubService extends IService<CoursePub> {

    /**
     * 课程发布预览
     * @param courseBaseId
     * @return
     */
    Map preview(Long courseBaseId);

    /**
     * 课程发布
     * @param courseBaseId
     * @return
     */
    ResponseResult publish(Long courseBaseId) throws IOException, TemplateException;

    /**
     * 已发布课程下架
     * @param courseId
     * @return
     */
    ResponseResult offlineById(Long courseId) throws ServerException, InvalidBucketNameException, InsufficientDataException, ErrorResponseException, IOException, NoSuchAlgorithmException, InvalidKeyException, InvalidResponseException, XmlParserException, InternalException;
}
